﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;
using System.Data;
using System.Data.SqlClient;
namespace BUS
{
    public class KhachHang_BUS
    {
        KhachHang_DAO khachhang;

        public DataTable LayDanhSachKhachHang()
        {
            khachhang = new KhachHang_DAO();
            return khachhang.LayDanhSachKhachHang();
        }

        public bool ThemKhachHang(KhachHang_DTO kh)
        {
            khachhang=new KhachHang_DAO();
            return khachhang.ThemKhachHang(kh);
        }

        public bool XoaKhachHang(KhachHang_DTO kh)
        {
            khachhang = new KhachHang_DAO();
            return khachhang.XoaKhachHang(kh);
        }

        public bool SuaKhachHang(KhachHang_DTO kh)
        {
            khachhang = new KhachHang_DAO();
            return khachhang.SuaKhachHang(kh);
        }

        public DataTable TimKiemTheoMaKhachHang(string ma)
        {
            khachhang = new KhachHang_DAO();
            return khachhang.TimKiemTheoMaKhachHang(ma);
        }

        public DataTable TimKiemTheoTenKhachHang(string ten)
        {
            ten.Trim();
            khachhang = new KhachHang_DAO();
            return khachhang.TimKiemTheoTenKhachHang(ten);
        }
    }
}
